Skip to content

Instantly share code, notes, and snippets.

Created January 11, 2012 21:14
Show Gist options
  • Save anonymous/1596794 to your computer and use it in GitHub Desktop.
Save anonymous/1596794 to your computer and use it in GitHub Desktop.
Первая задача из http://habrahabr.ru/blogs/java/136033/
fun main(args : Array<String>) {
val s = "fsdn kj nkjbh jhvbj jhb bhhbhj bb bbbbbbbbbb 32r wfrwefrw 324";
val parts = (s as java.lang.String).split("[^a-zA-Z]+"); // WTF?!
var max = ""
for (p in parts) if (p != null && p.length > max.length) max = p;
System.out?.println(max);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment