GoLang Solution For UVa Online Judge: 10493 - Cats, with or without Hats
GO Solution For UVa 10493 - Cats, with or without Hats. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.
A cat wears a hat if and only if it has N cats in its hat. There is exactly one cat that is not inside any other cat’s hat. If there are M cats without hats, how many cats are there?
Input Input consists of several test cases. For each case, there would be two integers, N and M , where 1 ≤ N < 1000...
You can find the full details of the problem Cats, with or without Hats at UVa Online Judge
2 5 3 4 3 3 0 0
2 5 9 3 4 Impossible 3 3 4
Solution: Please check the main.go snippet for the solution.
Solution originally posted at: Github by @codingsince1985