Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2), problem: (B) Valued Keys Solution In C/C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	string a,b;
	cin>>a>>b;
	int l=a.length();
	for(int i=0;i<l;i++)
	{
	     if(a[i]<b[i])
	    {
	    cout<<"-1";
	    return 0;
	    }
	}
	cout<<b;
}
(Visited 14 times, 1 visits today)

About the Author:

Leave A Comment