Sort by

recency

|

45 Discussions

|

  • + 0 comments

    Check out thia link for full solution with AI and ML use cases, https://youtu.be/0uIdaXmkMSE?si=v4KG2m63H1D45iui

  • + 0 comments

    from math import gcd total_outcomes = 6 * 6 favorable = 0 for i in range(1, 7): for j in range(1, 7): if i + j <= 9: favorable += 1 print(f"{favorable // gcd(favorable,total_outcomes)} / {total_outcomes//gcd(favorable,total_outcomes)}")

  • + 1 comment

    Quite dissapointed with the instructions of the problem statement , it is clearly mentioned to write a plain text , but we hav eto use print statement if it were python .!! SMH

  • + 0 comments

    from math import gcd

    def proba(n, k): count=0 dice1=range(1, n+1) dice2=range(1, n+1) for i in dice1: for j in dice2: if i + j <= k: count+=1 nbr_event = n*n

    pgcd=gcd(count, nbr_event)
    
    num=count//pgcd
    denum= nbr_event//pgcd
    
    return f"{num}/{denum}"
    

    proba(6, 9)

  • + 0 comments

    The expectations for this puzzle aren't really clear. For a standard pair of six-sided dice, the problem is simple enough that one can work out the math in one's head and hardcode the answer ("5/6" as @kongguibin pointed out). But in a real interview, would one be expected to implement the logic? And would one be expected to make the solution generalizable to m dice with n sides?