Skip to content

Instantly share code, notes, and snippets.

Avatar

Rohit Katyal RohitK09

  • AWS
  • United States
View GitHub Profile
@RohitK09
RohitK09 / word ladder inputs
Created Apr 23, 2017
inputs for Word ladder
View word ladder inputs
"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 Feb 3, 2017
Hamming Distance in JS
View hammingDistance.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 Aug 29, 2015
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
View Compression Code
package string;
public class CompressChar {
public String compressString(String str){
char last = str.charAt(0);
int count =0;