Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text.RegularExpressions;
- namespace Rextester
- {
- public class Program
- {
- public static void Main(string[] args)
- {
- int result = 0;
- for(int i = 10; i < 10000; i++)
- {
- if (i.ToString().Any(u => i.ToString().IndexOf(u) != i.ToString().LastIndexOf(u)))
- result += i;
- }
- Console.WriteLine(result);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement