-
-
Save sakapon/a85348186a8f49dc01980b83b4731d93 to your computer and use it in GitHub Desktop.
sumitrust2019 D - Lucky PIN (1)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
class D | |
{ | |
static void Main() | |
{ | |
Console.ReadLine(); | |
var s = Console.ReadLine(); | |
int i; | |
Console.WriteLine(Enumerable.Range(0, 1000).Select(x => $"{x:D3}").Count(p => (i = s.IndexOf(p[0])) > -1 && (i = s.IndexOf(p[1], i + 1)) > -1 && s.IndexOf(p[2], i + 1) > -1)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment