URI Online Judge Solution | 1332 One-Two-Three | UVA 12289

Reference: https://github.com/deniscostadsc/playground/blob/master/uri/1332/1332.cpp
Code:

Editorial:

Here we have to think like a child :D….So first we took a character array where we will take input string.And if the input is = 5 then it will print three as per the input set.And then when we enter the value input like ‘t’ and ‘o’ and ‘w’ then we can make it out from the string.So we have added this like this if t and w or if t or o or w or o is available then we will print 2 in the output where in string array t in the position 1, w is in the position 2, o is in the position 3

So basically the output case 2 we made the condition in the logic.

Note: In logic we must have to follow the sequence of the text One,Two,Three as suppose in two it can be two,too,ooo,owo  and as the input will do at most 100 words.So this steps has been taken 🙂