This file contains hidden or 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
| using System; | |
| using System.Timers; | |
| using Castle.MicroKernel.Registration; | |
| using Castle.Windsor; | |
| using Topshelf; | |
| namespace TopshelfBootstrapper | |
| { | |
| internal class Program | |
| { |
This file contains hidden or 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
Show hidden characters
| { | |
| "cmd": ["javac", "$file_name"], | |
| "cmd": ["java", "$file_base_name"], | |
| "working_dir": "${project_path:${folder}}", | |
| "selector": "source.java" | |
| } |
This file contains hidden or 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
| class Solution { | |
| public: | |
| bool vectorEquals(vector<int>& v1, vector<int>& v2){ | |
| if(v1.size()!=v2.size()) return false; | |
| for(int i=0; i<v1.size(); i++){ | |
| if(v1[i]!=v2[i]) | |
| return false; | |
| } | |
| return true; | |
| } |
This file contains hidden or 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
| class Solution { | |
| public: | |
| int minValue(const vector<int>& num, int start, int end){ | |
| int minValue=num[start]; | |
| for(int i=start+1; i<=end; i++){ | |
| if(num[i]<minValue){ | |
| minValue=num[i]; | |
| } | |
| } | |
| return minValue; |
This file contains hidden or 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
| ListNode *reverseBetween(ListNode *head, int m, int n) { | |
| // Start typing your C/C++ solution below | |
| // DO NOT write int main() function | |
| int count=n-m; | |
| ListNode* prev=new ListNode(0); | |
| ListNode* helper=prev; | |
| prev->next=head; | |
| while(m>1){ | |
| prev=prev->next; | |
| m--; |
This file contains hidden or 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
| class Solution { | |
| public: | |
| vector<int> computeFromLastRow(const vector<int>& prev, int rowNumber){ | |
| vector<int> v; | |
| int middle=(rowNumber%2==0)? rowNumber/2: (rowNumber+1)/2; | |
| for(int i=0; i<middle; i++){ | |
| v.push_back(i==0? 1: prev[i-1]+prev[i]); | |
| } | |
| for(int i=middle; i<rowNumber; i++){ |
This file contains hidden or 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
| class Solution { | |
| public: | |
| TreeNode* first; | |
| TreeNode* second; | |
| TreeNode* prev; | |
| void recoverTreeRecursively(TreeNode* root){ | |
| if(root!=NULL){ | |
| recoverTreeRecursively(root->left); | |
This file contains hidden or 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
| class Solution { | |
| public: | |
| void getPathSum(TreeNode* root, vector<vector<int> >& v, vector<int>& currentV, int currentSum, int sum){ | |
| if(currentSum==sum){ | |
| v.push_back(currentV); | |
| return; | |
| } | |
| if(root | |
This file contains hidden or 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
| class Solution { | |
| public: | |
| while(startCol+step < endCol){ | |
| int temp=matrix[startRow][startCol+step]; | |
| matrix[startRow][startCol+step]=matrix[endRow-step][startCol]; | |
| matrix[endRow-step][startCol]=matrix[endRow][endCol-step]; | |
| matrix[endRow][endCol-step]=matrix[startRow+step][endCol]; | |
| matrix[endRow-bottomRow][endCol]=temp; | |
| step++; | |
| } |
This file contains hidden or 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
| Sublime Text 2 - Default shortcuts cheatsheet (PC keyboard) | |
| ----------------- | |
| General | |
| ----------------- | |
| * Go to file (CTRL + P) | |
| * Go to project (CTRL + ALT + P) | |
| * Go to methods (CTRL + R) | |
| * Go to line (CTRL + G) | |
| * Toggle side bar (CTRL + KB) |
NewerOlder