Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Luke4 {
- static private var list = [Int]();
- static private var counter = 0;
- static private func isSpecial(n: Int) -> Bool {
- return n % 7 == 0 || String(n).contains("7");
- }
- static func solve() {
- for n in 1...1337 {
- if (isSpecial(n: n)) {
- list.append(list[counter]);
- counter += 1
- } else {
- list.append(n)
- }
- }
- print(list[1336])
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement