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
| import java.util.Map; | |
| import java.util.HashMap; | |
| import java.util.Queue; | |
| import java.util.LinkedList; | |
| import java.util.List; | |
| import java.util.ArrayList; | |
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
| import java.util.Map; | |
| import java.util.HashMap; | |
| import java.util.Set; | |
| import java.util.HashSet; | |
| import java.util.Queue; | |
| import java.util.LinkedList; | |
| import java.util.List; |
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
| import java.util.Map; | |
| import java.util.HashMap; | |
| import java.util.Set; | |
| import java.util.HashSet; | |
| import java.util.LinkedList; | |
| import java.util.Queue; | |
| import java.util.Stack; |
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
| import java.util.*; | |
| public class StringBuildReverse | |
| { | |
| public static void main(String args[]) | |
| { | |
| String s = "test"; | |
| StringBuilder sb = new StringBuilder(s); | |
| StringBuilder sbR = sb.reverse(); |
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
| import java.util.Scanner; | |
| import java.util.List; | |
| public class Solution | |
| { | |
| public static void main(String args[]) | |
| { | |
| // Construct a Scanner with the argument System.in to read from | |
| // standard input. | |
| Scanner scan = new Scanner(System.in); |
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
| #include <iostream> | |
| // So I don't have to include "std::" every time... | |
| using namespace std; | |
| int main() | |
| { | |
| // Declare the variable you wish to read into... | |
| int apples; | |
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
| import java.util.Scanner; | |
| public class Solution | |
| { | |
| public static void main(String args[]) | |
| { | |
| // Construct a Scanner with the argument System.in to read from | |
| // standard input. | |
| Scanner scan = new Scanner(System.in); | |
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
| #include <iostream> | |
| #include <vector> | |
| using namespace std; | |
| class Solution { | |
| int find(vector<int>& nums, int start, int end, int target) | |
| { | |
| int lo = start, hi = end, mid; |
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
| bool safe(int grid[9][9], int row, int col) | |
| { | |
| for (int i = 0; i < 9; ++i) | |
| { | |
| if (i != col && grid[row][i] == grid[row][col]) | |
| { | |
| return false; | |
| } | |
| } | |
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
| #include <iostream> | |
| #include <string> | |
| #include <vector> | |
| #include <map> | |
| #include <utility> | |
| #include <algorithm> | |
| using namespace std; | |
| void accumulateIndices(string container, string c, vector<int>& positions) |