Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View RohitK09's full-sized avatar

Rohit Katyal RohitK09

View GitHub Profile
from collections import deque
import string
def string_transformation(words, start, stop):
"""
Args:
words(list_str)
start(str)
stop(str)
Returns:
@RohitK09
RohitK09 / System Design.md
Created June 26, 2022 23:15 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@RohitK09
RohitK09 / word ladder inputs
Created April 23, 2017 20:31
inputs for Word ladder
"sand" start
"acne" end
dictionary
["slit","bunk","wars","ping","viva","wynn","wows","irks","gang","pool","mock","fort","heel","send","ship","cols","alec","foal","nabs","gaze","giza","mays","dogs","karo","cums","jedi","webb","lend","mire","jose","catt","grow","toss","magi","leis","bead","kara","hoof","than","ires","baas","vein","kari","riga","oars","gags","thug","yawn","wive","view","germ","flab","july","tuck","rory","bean","feed","rhee","jeez","gobs","lath","desk","yoko","cute","zeus","thus","dims","link","dirt","mara","disc","limy","lewd","maud","duly","elsa","hart","rays","rues","camp","lack","okra","tome","math","plug","monk","orly","friz","hogs","yoda","poop","tick","plod","cloy","pees","imps","lead","pope","mall","frey","been","plea","poll","male","teak","soho","glob","bell","mary","hail","scan","yips","like","mull","kory","odor","byte","kaye","word","honk","asks","slid","hopi","toke","gore","flew","tins","mown","oise","hall","vega","sing","fool","boat","bobs","lain","soft","hard","rots","sees","apex"
@RohitK09
RohitK09 / hammingDistance.js
Created February 3, 2017 04:23
Hamming Distance in JS
/**
* @param {number} x
* @param {number} y
* @return {number}
*/
var hammingDistance = function(x, y) {
var resultStr =( x^y);
let count =0;
while(resultStr>0){
resultStr =(resultStr&resultStr-1) ;
@RohitK09
RohitK09 / Compression Code
Last active August 29, 2015 14:08
Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a2blc5a3. If the "compressed" string would not become smaller than the original string, your method should return the original strin
package string;
public class CompressChar {
public String compressString(String str){
char last = str.charAt(0);
int count =0;