# Doubt regarding test-cases in problem- The maximum substring of August Easy Hackerearth

**URL:** <https://discuss.codechef.com/t/doubt-regarding-test-cases-in-problem-the-maximum-substring-of-august-easy-hackerearth/73634>\
**Category:** Uncategorized\
**Created:** [August 1, 2020, 12:07pm UTC](https://discuss.codechef.com/t/doubt-regarding-test-cases-in-problem-the-maximum-substring-of-august-easy-hackerearth/73634 "2020-08-01T12:07:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unsung\_heroes](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@unsung\_heroes](https://discuss.codechef.com/u/unsung_heroes)\
**Post date:** [August 1, 2020, 12:07pm UTC](https://discuss.codechef.com/t/doubt-regarding-test-cases-in-problem-the-maximum-substring-of-august-easy-hackerearth/73634/1 "2020-08-01T12:07:24Z")

</div>

## [Link to the problem on Hackerearth](https://www.hackerearth.com/practice/algorithms/string-algorithm/string-searching/practice-problems/algorithm/maximum-substring-9b97fc5f/description/) If we take the string as “apyzayz” , I think the output should be “yz” . But some solutions getting “a” as the output for this testcase, got an AC solution. When I ran @aryanc403 's solution (Screenshot below) against the provided custom input, it gave the answer as “a”. [Link to the solution](https://www.hackerearth.com/challenges/competitive/august-easy-201/algorithm/maximum-substring-9b97fc5f/submission/44993634/) ![Screenshot (847)](https://s3.amazonaws.com/discourseproduction/original/3X/c/b/cb8e294d4ae44b972555f313801ba01d717a52ec.png)

**Next ambiguity** I feel is that for the input as “xyzabcabcxyz”, the correct answer should be “xyz” as the question says “_print the one with the minimum index of the first occurrence._” But there are many solutions which are giving “abc” as the output and still got AC. [Link to one such solution](https://www.hackerearth.com/challenges/competitive/august-easy-201/algorithm/maximum-substring-9b97fc5f/submission/45001062/)  
@aryanc403 Please correct me if I am wrong.

---

<div class="post-metadata">

**Author:** ![unsung\_heroes](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@unsung\_heroes](https://discuss.codechef.com/u/unsung_heroes)\
**Post date:** [August 1, 2020, 2:21pm UTC](https://discuss.codechef.com/t/doubt-regarding-test-cases-in-problem-the-maximum-substring-of-august-easy-hackerearth/73634/3 "2020-08-01T14:21:58Z")

</div>

sad ☹

---

<div class="post-metadata">

**Author:** ![hackraj](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@hackraj](https://discuss.codechef.com/u/hackraj)\
**Post date:** [August 1, 2020, 2:30pm UTC](https://discuss.codechef.com/t/doubt-regarding-test-cases-in-problem-the-maximum-substring-of-august-easy-hackerearth/73634/4 "2020-08-01T14:30:16Z")

</div>

it’s hackerearth my friend 😀
