Python Developers/Programmers, answer this

Imperial College London / Strategy
Struggler

Imperial College London Strategy

PRE
Google
Strugglermore
Sep 7 10 Comments

Grab 'solve_me' and post your code
d = {'k1':[1,2,{'k2':['Blind this is tricky',{'tough':[1,2,['solve_me']]}]}]}

Did you fire up your IDE and how long did it take?

21 VOTES SELECT ONLY ONE ANSWER
VOTE VIEW RESULT

comments

Want to comment? LOG IN or SIGN UP
TOP 10 Comments
  • Pandora x0kjF
    d['k1'][2]['k2'][1]['tough'][2][0]

    did I pass the test cases mommy?
    Sep 7 4
    • Imperial College London / Strategy
      Struggler

      Imperial College London Strategy

      PRE
      Google
      Strugglermore
      OP
      Damn it. I'll be back...
      Sep 7
    • Pandora x0kjF
      We're leetcode experts here kid, nuttin personnel
      Sep 7
    • New / Strategy poorPaul
      Hey this is a leetcode problem?
      Sep 7
    • Pandora x0kjF
      This is child's play when compared to L E E T C O D E
      Sep 7
  • Airbnb GreatIdea
    Whoever wrote this kind of data structure should be fired.
    Sep 7 0
  • eBay truethat
    From top of what I remember:

    Import numpy

    e = numpy.flatten(d)
    print(e[len(e)-1])
    Sep 7 2
    • Imperial College London / Strategy
      Struggler

      Imperial College London Strategy

      PRE
      Google
      Strugglermore
      OP
      Stahp this- Numpy has no attribute 'flatten'
      Sep 7
    • New / Strategy poorPaul
      It's
      ndarray.flatten()
      Sep 7
  • New / Strategy poorPaul
    That fuckin mess of dict and lists
    Sep 7 0