You can simply map the flavors since the constraints are low (about 10000) which will save you time for searching for a pair of matching flavor for each flavor.
This is the blog of site xoptutorials.com. All the news will be posted here and on the facebook page of xoptutorials.
Showing posts with label HackerRank::Algorithms::Search. Show all posts
Showing posts with label HackerRank::Algorithms::Search. Show all posts
Tuesday, July 28, 2015
Friday, April 24, 2015
HackerRank::Algorithms::Search::Connected Cell in a Grid
We just need to implement the process where we get flood the region. Both recursive and non-recursive approach is ok, I did the recursive one because it is somewhat shorter to write. Have a look at it below.
Subscribe to:
Posts (Atom)