Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finding the Nth Element in an Array #40

Merged
merged 6 commits into from
Oct 22, 2024

Conversation

Sohammhatre10
Copy link
Contributor

@Sohammhatre10 Sohammhatre10 commented Oct 15, 2024

New Nada Example

Description

This example introduces a program that helps users find the Nth largest element in a list or array of SecretIntegers. The program solves a common problem of selecting a specific element by size from a given dataset, while maintaining security by handling secret integers. The example is further extended to show how Nada can handle multi-dimensional arrays, adding flexibility and depth for more complex use cases.

Changes:

  • Added nth_element_of_an_array.py to the src/ directory.
  • Added nth_element_of_an_array_test.yaml to the tests/ directory for testing various edge cases and array dimensions.
  • Updated nada-project.toml to include this new program.

Use Case

The target use cases for this example include:

  • Retrieving the Nth largest element from a dataset, useful in sorting algorithms, competitive programming, and data analysis.
  • Securely working with SecretIntegers to ensure privacy during computations.

Related Issues

This pull request addresses issue #17, which requested a new example for selecting the Nth element from an array.

Optional: add your information for a Nada by Example Contributor POAP

Your Twitter:
Your Ethereum address:

@jimouris jimouris requested a review from oceans404 October 16, 2024 13:40
@jimouris
Copy link
Member

@Sohammhatre10 LGTM! @oceans404 feel free to merge!

@oceans404 oceans404 merged commit 203298a into NillionNetwork:main Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants