C ++ program to check if given encoding represents a single string .
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool isUnique ( int a [ ] , int n , int k ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum += a [ i ] ; sum += n - 1 ;