#Longest array subsequence of distinct numbers

12 messages · Page 1 of 1 (latest)

strong citrusBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

zinc totem
#

no I think you probably do want two for loops

#

the classic approach here (at least the expected one) is probably the double pointer or double index approach

#

though a dynamic programming solution also exists iirc

eternal scroll
zinc totem
#

well, at least try something yourself first, then show us the code you tried

#

it would be against the server rules (Rule #5 specifically) to just hand you a solution

eternal scroll
strong citrusBOT
#
How to Ask A Programming Question

Anyone can ask a question in our programming channels. Following the guide Writing The Perfect Question is recommended.

What To Post

State your problem clearly and provide all necessary details:

  • the relevant portion of your code, or all of it
  • the expected output
  • the actual output (or the full error) 🏆 Gold Standard: Minimal Reproducible Example
Where To Post

Provide the relevant code in the message, and format it nicely with a code block*. If it's too much for one message, you can upload it:

  • Compiler Explorer for most C/C++ snippets
  • OnlineGDB for interaction, debugging ⛔ Do not post screenshots, let alone photos of your screen!
zinc totem
#

please observe the common guidelines when asking

#

format your code, provide reasonably complete examples, specs, requirements, input/output/expectations, no screenshots, etc

zinc totem