Skip to content

Instantly share code, notes, and snippets.

View abdulrehmank's full-sized avatar

Abdul Rehman Khairdi abdulrehmank

View GitHub Profile
function solution(S) {
// write your code in JavaScript (Node.js 6.4.0)
console.log(S);
var longest_string_length = -1;
for(var j = 0; j < S.length; j++) {
var len = S.length;
for(k = len; k > j; k--) {
var str = S.substring(j, k),
patt = /([A-Z]*[a-z]*[A-Z]+[a-z]*)+/g,
match = patt.exec(str);