This file contains 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
var blocks = ["A","A","A","A","A","A","A","A","A","A","A","A","B","B","A","C","C","C","C","D","D","D","D","A","A","E","E","E","A"]; | |
function Encode(input){ | |
var segmentLength = blocks.length; | |
var run = 0, current = '', last = '', encoded = ''; | |
current = last = blocks[0]; | |
for(var i = 1; i <= segmentLength; i++){ | |
if(current !== last){ |
This file contains 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
def delete_first(self): | |
deleted = self.head | |
if self.head: | |
self.head = self.head.next | |
deleted.next = None | |
return deleted |
This file contains 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 the JavaScript language, have the function LetterCount(str) take the str parameter being passed and return the first word with the greatest number of repeated letters. For example: "Today, is the greatest day ever!" should return greatest because it has 2 e's (and 2 t's) and it comes before ever which also has 2 e's. If there are no words with repeating letters return -1. Words will be separated by spaces. | |
// Input = "Hello apple pie" Output = Hello | |
// Input = "No words" Output = -1 | |
function LetterCount( str ) { | |
var words = str.split( ' ' ); | |
var longest = 0; | |
var longest_word; | |
for ( var i = 0; i < words.length; i++ ) { |