A Group Portal
  Go Back to Contest Details

Firstnaukri Code Ninja Programming Contest

Quarter Final
Quarter Final phase is closed. Results pending
* Write a program in C to solve the following puzzle.
* Compress your source code in a .zip file and upload the same before the deadline.


Given a string S, find the count of anagram sub-sequences from S of length 3 or more . Two or more strings are anagrams if they comprise of
exactly the same characters in different order. For Example: The strings ABC, CAB, BCA are anagrams
Your program should accept the string S from the console and write the count of anagram sub-sequences as output to the console.

Illustration 1:
Consider an input sequence
ABCDEFCBAHIBAC

Output
1

In the above case there is only one sub-sequence of length 3 ore more i.e. ABC with anagrams CBA and BAC.

Illustration 2:
Consider an input sequence
ABHIKGKHIBA


Output:
5

In the above case there are five sub-sequence of length 3 ore more i.e.
ABHIK - KHIBA
ABHI - HIBA
BHIK - KHIB
BHI - HIB
HIK - KHI

Contest by

Prize