straightforward logic but did not pass 3/9 test cases. not sure why? Could someone help?

  • 0
    select A.question_id as survey_log from
        (select SL1.question_id, count(SL1.action) as numA from survey_log SL1
        where SL1.action='answer'
        group by SL1.question_id) A join
        (select SL2.question_id, count(SL2.action) as numS from survey_log SL2
        where SL2.action='show'
        group by SL2.question_id) S
        on A.question_id=S.question_id
        order by (numA/numS) desc
        limit 1

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.