You are not logged in. Please login at www.codechef.com to post your questions!

×

[closed] CodeSurf17 - VORTEX2 Doubt

the link to the problem: here

My Solution: link

I have checked the top of both strings and printed the lexicographically smaller one,

if both characters are same, I have traversed both the strings until I find a difference in character or I reach the end of one of the strings,

and according to the character after the above loop, I have printed either the first or second string's characters.

I've tested my code on various test cases,

Can someone tell me where I have gone wrong? or provide a testcase where my code fails?

asked 05 Feb '17, 00:22

swetankmodi's gravatar image

6★swetankmodi ♦♦
6008
accept rate: 15%

closed 02 Oct '17, 22:22

The question has been closed for the following reason "The question is answered, right answer was accepted" by swetankmodi 02 Oct '17, 22:22


Your code is failing in following test cases...

INPUT

1

BCOEJUVPVABOYG

OE

Output

Yours - BCOEOEJUVPVABOYG

But Correct is - BCOEJOEUVPVABOYG

link

answered 05 Feb '17, 01:00

bansal1232's gravatar image

5★bansal1232
2.8k1419
accept rate: 16%

edited 05 Feb '17, 01:00

thanks a lot! (I changed the first string to smaller one(length) and second string to the larger one in my code and it works now)

(05 Feb '17, 01:29) swetankmodi ♦♦6★

I checked a lot of cases on your code. The only anomaly I found was what bansal stated. This OEJU thing was the nightmare...

link

answered 05 Feb '17, 01:48

vijju123's gravatar image

5★vijju123 ♦♦
15.5k12066
accept rate: 18%

1

thanks a lot! (it's not letting me upvote you idk why)

(05 Feb '17, 13:27) swetankmodi ♦♦6★
1

Np dear. I never answer for upvotes, I just want to learn :)

(05 Feb '17, 13:49) vijju123 ♦♦5★

My solution was also giving wa, giving correct output even for above oeju case. Can someone tell me where I have done wrong?? My solution:: https://www.codechef.com/viewsolution/12726722

link

answered 05 Feb '17, 02:54

ayush_agrawal_'s gravatar image

4★ayush_agrawal_
2614
accept rate: 11%

@ayush_agrawal_

INPUT

1

VY

TMWCYSYYCQPEVIKEF

Output

Correct: TMVWCYSYYCQPEVIKEFY

Yours : TMVWCYYSYYCQPEVIKEF

link

answered 05 Feb '17, 03:43

bansal1232's gravatar image

5★bansal1232
2.8k1419
accept rate: 16%

edited 05 Feb '17, 03:43

You seem to be having some superpower when it comes to finding test cases!! SERIOUSLY!!!

(05 Feb '17, 09:53) vijju123 ♦♦5★

hahaha! i m normal guy like you.

(05 Feb '17, 17:37) bansal12325★

thanks bro..

link

answered 05 Feb '17, 15:15

ayush_agrawal_'s gravatar image

4★ayush_agrawal_
2614
accept rate: 11%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,024
×354
×173

question asked: 05 Feb '17, 00:22

question was seen: 567 times

last updated: 02 Oct '17, 22:22