NEC Tech technical Questions coderinme

NEC Tech technical Questions in AMU

It was AMU Aligarh Placement drive for B.Tech/M.Tech/M.C.A. these were Questions for First round.
Q1. The Problem was to find Number of common Guests in all parties if user give the input in the following format
The guests list for parties is in one line separated by Comma(,)
e.g. Guest id

122,444,2223,122,1111,122,2233,123,333,333,444,1111,122then the output should be following
2233:1
2223:1
333:2
444:2
1111:2
122:4
123:1

We are providing python solution for that question

#!/bin/python

import sys


line = raw_input()
y = line.strip().split(',')
temp=set(y)
result={}
for i in temp:
    result[i]=y.count(i)
for i in temp:
    print (str(i)+":"+str(result[i]))

NEC Tech technical Questions

Click  here for other Competitive questions
For other companies technical questionThoughtworks

All rights reserved. No part of this Post may be copied, distributed, or transmitted in any form or by any means, without the prior written permission of the website admin, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. For permission requests, write to the owner, addressed “Attention: Permissions Coordinator,” to the admin@coderinme.com

A web developer(Front end and Back end), and DBA at csdamu.com. Currently working as Salesforce Developer @ Tech Matrix IT Consulting Private Limited. Check me @about.me/s.saifi

Leave a reply:

Your email address will not be published.