Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

IITI13 - Editorial

$
0
0

Problem : Sherlock and Ciphers

Difficulty :

Cakewalk

Prerequisites :

None

Problem :

Given an array A and string S, swap ith and A[ith] character of S in order 1 to N.

Explanation :

This is a straightforward implementation problem. For each test case, you need to read N (size of string and array) and then string S and finally array A. Now iteratively,you need to traverse the array starting from 1 to N and swap the ith and A[ith] character in S.

Note : The indices of A are 1-based. If someone is implementing 0-based index then he needs to swap the characters accordingly.

Author's Solution can be foundhere


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>