Sector Seven

7.01 - return two+three+one+one+three+two;
7.02 -  return s.Substring(0, s.Length/2);
7.03 - return a.Replace(b,c);
7.04 - string w = "";
char[] charArray = s.ToCharArray();
    Array.Reverse( charArray );
w = new string ( charArray );
return w;
7.05 - string r = "";
for(int i = 0; i < a.Length ;i++){
if (i % 2 == 0){
r += b.Substring(i, 1);
}
else
r += a.Substring(i, 1);

}

return r;
7.06 - return s.Replace(" ", "");
7.07 - return s.Replace("a", "").Replace("e", "").Replace("i", "").Replace("o", "").Replace("u", "");
7.08 - string r = "";
r = input.Replace(a, "").Replace(b, "").Replace(c, "");
if (r == "" && input.Contains(a) && input.Contains(b) && input.Contains(c)){
return true;
}
return false;
7.09 - string r = "";
for(int id = 0; id<i-1; id++){
r += s + " ";
}
        return r + s;
7.10 -(thanks to RainVision for this one)
using System;
using System.Linq;

public class Program {
public static string Puzzle(int t) {
return String.Join(" ", Enumerable.Repeat("a b c d e f g h i j k l m n o p q r s t u v w x y z", t)).Substring(0, 52*t-t*2) + "z";
}

}

No comments:

Post a Comment