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
| from selenium import webdriver | |
| from selenium.webdriver.common.by import By | |
| from selenium.webdriver.common.action_chains import ActionChains | |
| from selenium.webdriver.support.ui import WebDriverWait | |
| from selenium.webdriver.support import expected_conditions as EC | |
| import time | |
| driver = webdriver.Chrome() | |
| driver.get("https://open.spotify.com") |
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
| // Advent of Code Day 2 |
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
| // Advent of Code Day 1 | |
| fs = require('fs') | |
| fs.readFile('test1.txt', 'utf8', function (err,str) { | |
| if (err) { | |
| return console.log(err); | |
| } | |
| let lines = str.split("\n\n"); |
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 TrieNode{ | |
| boolean isEnd=false; | |
| private TrieNode[] links = new TrieNode[26]; | |
| public boolean containsKey(Character c){ | |
| return links[c-'a'] != null; | |
| } | |
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 String addBinary(String a, String b) { | |
| if (a.length() > b.length()) { | |
| int diff = a.length()-b.length(); | |
| for(int i=0;i<diff;i++) { | |
| b="0"+b; | |
| } | |
| } else if (b.length() > a.length()) { | |
| int diff = b.length()-a.length(); |
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 romanToInt(String s) { | |
| int result =0; | |
| int length = s.length()-1; | |
| int i=0; | |
| while (i<length) { | |
| if (getValue(s.substring(i,i+2))!= -1) { | |
| System.out.println(s.substring(i,i+2)); | |
| System.out.println(getValue(s.substring(i,i+2))); |
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 boolean backspaceCompare(String s, String t) { | |
| Stack<Character> stackS = new Stack<Character>(); | |
| for(Character c: s.toCharArray()){ | |
| if (c.equals('#')) { | |
| if (stackS.size()> 0) { | |
| stackS.pop(); | |
| } | |
| } else { | |
| stackS.push(c); |
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 boolean containsDuplicate(int[] nums) { | |
| HashSet<Integer> set = new HashSet<Integer>(); | |
| for(int i: nums){ | |
| if(set.contains(i)){ | |
| return true; | |
| } else { | |
| set.add(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
| /** | |
| * Definition for a binary tree node. | |
| * public class TreeNode { | |
| * int val; | |
| * TreeNode left; | |
| * TreeNode right; | |
| * TreeNode() {} | |
| * TreeNode(int val) { this.val = val; } | |
| * TreeNode(int val, TreeNode left, TreeNode right) { | |
| * this.val = val; |
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
| /** | |
| * Definition for singly-linked list. | |
| * public class ListNode { | |
| * int val; | |
| * ListNode next; | |
| * ListNode() {} | |
| * ListNode(int val) { this.val = val; } | |
| * ListNode(int val, ListNode next) { this.val = val; this.next = next; } | |
| * } | |
| */ |
NewerOlder