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
| // The bad | |
| isFound boolean = true; | |
| while(isFound) | |
| isFound = false; | |
| for(j int from 1 to array.getSize()) | |
| if (array[j].attribute == "lookupValue") | |
| array.removeElement(j); | |
| isFound = true; | |
| end | |
| end |
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
| fun main(args:Array<String>){ | |
| Application.launch(javaClass<Foo>()) | |
| } | |
| fun <T:Any> T.builder(f:T.()->Unit):T{ | |
| this.f() | |
| return this | |
| } | |
| class Foo : Application(){ |
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.text.DateFormat | |
| import java.time.LocalDate | |
| import java.util | |
| import java.util.* | |
| /* | |
| Given a list of people with their birth and end years (all between 1900 and 2000), | |
| find the year with the most number of people alive. | |
| See http://qr.ae/RAG2zH | |
| */ |
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
| <?php | |
| // Data on which we operate | |
| $tree=[ | |
| '+'=>[ | |
| '*'=>[1,2], | |
| '-'=>[ | |
| '+' => [3,4] | |
| , 5 |
NewerOlder