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

×

STONES Wrong Answer

for _ in range (int(input())): j=input() s=input() a=list(set(j)&set(s)) l=len(a) print(l) above code gives correct output but after submitting it shows wrong answer why?

asked 10 Jan, 17:15

utsav_akash's gravatar image

2★utsav_akash
1
accept rate: 0%


Problem is due to usage of set. Set only contain unique elements So input aabbaa will become {a,b} which can work for first input but not for second input.

Use list for second input.

Check out my submission : LINK

link

answered 11 Jan, 00:14

ay2306's gravatar image

3★ay2306
2029
accept rate: 11%

toggle preview
Preview

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:

×15

question asked: 10 Jan, 17:15

question was seen: 43 times

last updated: 11 Jan, 00:14