Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

leetcode perl solutions

by NetWallah (Canon)
on Jan 23, 2022 at 20:17 UTC ( [id://11140747]=perlquestion: print w/replies, xml ) Need Help??

NetWallah has asked for the wisdom of the Perl Monks concerning the following question:

I was recently introduced to leetcode problems (https://leetcode.com/).

As a good monk, I would love to hack these using perl, but the site does not provide any options to to do so (many other, far less desirable options languages are offered).

I'm sure fellow monks have considered this. Please share hacks/workarounds/solutions to approach this, or even suggestions on an approach.

Thanks.

                "If you had better tools, you could more effectively demonstrate your total incompetence."

Replies are listed 'Best First'.
Re: leetcode perl solutions
by pryrt (Abbot) on Jan 23, 2022 at 22:39 UTC
    option #4: if the machine that they are running the code on happens to have a perl interpreter, just not exposed through their interface, write a wrapper script in the language of your choice that they do make available, which pipes the text of you perl source to the perl executable (either through pipe or system or what have you)... it's worth a try, anyway. (if they show you the output of a normal submission, even if it doesn't fulfill their requirements, submit a program that just searches the PATH and standard /usr/bin/perl and similar locations to see if perl exists and is executable).

    this suggestion assumes that nothing I have suggested falls outside their terms and conditions

Re: leetcode perl solutions
by LanX (Saint) on Jan 23, 2022 at 21:55 UTC
    Hello NetWallah

    From what I can see they need to actively provide a Perl engine at the back-end to run the code.

    I quickly searched their discussion board and found 3 threads requesting Perl, alas without answer.

    Like https://leetcode.com/discuss/feedback/1051600/Perl-support-wanted

    So, I only see 3 options

    • you convince many monks to join leetcode to petition in large numbers in the board.
    • you start punishing their snobbish attitude, by "steeling" their questions to discuss them here on PM. (a win for the monastery)
    • a combination of the former two

    HTH! :)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Re: leetcode perl solutions
by eyepopslikeamosquito (Archbishop) on Jan 24, 2022 at 05:11 UTC
Re: leetcode perl solutions
by kcott (Archbishop) on Jan 24, 2022 at 00:24 UTC

    G'day NetWallah,

    I had a look around some of the problems listed. It seems that many are quite similar to the type of questions we get here: we post solutions; discuss different approaches; and often provide benchmarks.

    Far from stealing (as LanX suggested) I think it would be totally legitimate to discuss Perl solutions to those problems here. It's quite likely that at least some problems were discussed here before they were posed by LeetCode.

    I've just posted a quick solution to the first problem, "LeetCode Problem #1 - Two Sum - Improve and/or discuss.", so that we can gauge interest in discussing these.

    — Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11140747]
Approved by hippo
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2025-07-09 23:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.