Python Forum
Two Python problems to solve
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Two Python problems to solve
#1
Solving 2 problems

Goodnight.
I have two problems and I would like help from my colleagues to resolve them. Are they:

Problem 1) Suppose someone presents you with a bag containing an odd number of numbers, be it 2m+1, with m > 300,000,000.
Also, be told that the numbers appear in pairs, with the exception of one of them. For example, inside the bag, S, there could be S = [[4, 6, 8, 6, 4]]. Find out what this different number is. Explain how much time and memory your algorithm takes to solve this problem.

Problem 2) Suppose you are asked to find the ranking of an integer m in the sequence L from 0 to n, be it r(n) in which chains with at least two consecutive 1's are prohibited. For example,
r(000) = 1; r(001) = 2, r(010) = 3, r(011) = 3 and r(100) = 4. Note that r(011) contains a prohibition and therefore, r(010) = r(011) = 3 .
Reply
#2
Please post the work you have done toward solving these problems.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to solve this problem Python configuration? magomes 5 366 Mar-22-2024, 11:11 PM
Last Post: magomes
  How to solve pancake flip with Python longmen 5 2,049 May-09-2022, 05:16 PM
Last Post: deanhystad
Star Interesting Intro to python problem I can't solve. Honestworker 5 12,277 Mar-04-2021, 02:05 AM
Last Post: BashBedlam
  solve probability problem by python Dreammer 1 1,839 Dec-24-2020, 09:51 AM
Last Post: Larz60+
  Cross word puzzle solve using python constraint library aliyark145 1 3,285 Nov-29-2018, 10:53 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020