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
| var fn1 = function(a,b){ console.log(a+b); } | |
| var fn2 = (function(a,b){ console.log(a+b); }) |
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
| -- This script takes 10s to run | |
| maxm [] = error "No maximum for blank list" | |
| maxm [x] = x | |
| maxm (x:xs) = max x (maxm xs) | |
| main = print (maxm [1..100000000]) | |
| -- This script takes 10s to run |
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
| String::linear_search = (from,to,sub) -> | |
| i = from | |
| j = 0 | |
| max = sub.length | |
| while (to - i + 1) >= (max-j) | |
| if @[i] == sub[j] | |
| i++; j++ | |
| else | |
| j = 0; 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
| def change_price_to_corresponding_lac price | |
| p_num = price.split(/[lacroe]+/)[0] | |
| price.slice! p_num | |
| p_string = price.strip | |
| p_num.strip! | |
| price = p_num.to_d | |
| price = p_num.to_d * 100 if (p_string == 'cr' or p_string == 'crore' or p_string == 'c') | |
| price |
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
| function l() { | |
| } |