This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tar (tar from GNUWin32) | |
$ & "C:\PFiles_x86\PT\GnuWin32\bin\tar.exe" --version | |
tar (GNU tar) 1.13 | |
Copyright (C) 1988, 92,93,94,95,96,97,98, 1999 Free Software Foundation, Inc. | |
This is free software; see the source for copying conditions. There is NO | |
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
Written by John Gilmore and Jay Fenlason. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ref code, https://docs.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.displayname | |
// compiled by https://dotnetfiddle.net/ | |
CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME | |
iv ivl IVL Invariant Language (Invariant Country) | |
af af afr AFK af Afrikaans | |
agq agq agq ZZZ Aghem Aghem | |
ak ak aka ZZZ Akan Akan | |
am am amh AMH am Amharic | |
ar ar ara ARA ar Arabic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for leetcode meetup | |
// O(2^n), O(2^n) | |
public IList<IList<int>> Subsets(int[] nums, int index = nums.Length) { | |
if (index == 0) | |
return new List<IList<int>>(new IList<int>[] { new List<int>() }); | |
var temp = Subsets(nums, index - 1); | |
int tempLength = temp.Count; | |
for (int i = 0; i < tempLength; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// complexity less than n lg n | |
public class Solution { | |
List<List<Node>> vertListPos; // for positive | |
List<List<Node>> vertListNeg; // for negative | |
List<List<Node>> vertList = null; // pointer | |
internal class Node { | |
public int val { get; set; } | |
public int level { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// O(row*col), O(1), O(row+col) stack space | |
public class Solution { | |
char[][] grid; | |
public int NumIslands(char[,] grid) { | |
int count = 0; | |
for (int r=0; r<numRows; r++) | |
for (int c=0; c<numCols; c++) | |
if (grid[r][c] == '1') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// O(N), O(N) | |
public class Solution { | |
public int Rob(int[] nums) { | |
var dp = new int[nums.Length]; | |
for (int i=0; i<nums.Length; i++) | |
dp[i] = Math.Max((i < 2? 0 : dp[i-2]) + nums[i], i<1? 0 : dp[i-1]); | |
return nums.Length == 0 ? 0 : dp[nums.Length-1]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// O(N) Time , O(lg N) Space | |
public class Solution { | |
IList<int> nodeList = null; | |
public IList<int> RightSideView(TreeNode root) { | |
nodeList = new List<int>(); | |
FindRight(root); | |
return nodeList; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
UVA#11557 Reference | |
Solution Link: | |
This is the chinese solution acquired from: http://blog.csdn.net/accelerator_/article/details/38783651 | |
referred by Yonghui Wu (http://www.cs.fudan.edu.cn/en/?page_id=2269) | |
Generates | |
Complexity: | |
Generates Pattern string from the input code fragment of repository n times: | |
P[1...m], P[2...m], P[3...m], P[4...m], ....., P[m..m] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# moved to https://github.com/atiq-cs/Scripts-And-Utilities/wiki/choco-batch-install-or-upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS > choco install googlechrome -ia "'INSTALLFOLDER=D:\PFiles_x64\choco\chrome'" -y | |
Chocolatey v0.10.11 | |
Installing the following packages: | |
googlechrome | |
By installing you accept licenses for the packages. | |
Progress: Downloading GoogleChrome 68.0.3440.8400... 100% | |
GoogleChrome v68.0.3440.8400 [Approved] | |
googlechrome package files install completed. Performing other installation steps. | |
WARNING: Unable to find the architecture of the installed Google Chrome application |
NewerOlder