You are not logged in. Please login at 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

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


answered 11 Jan, 00:14

ay2306's gravatar image

accept rate: 11%

toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 10 Jan, 17:15

question was seen: 43 times

last updated: 11 Jan, 00:14