Skip to content

ByteLegendQuest/java-fix-index-out-of-bounds-exception

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ByteLegend Challenge of JavaIsland: Fix ArrayIndexOutOfBoundsException

English

Fix ArrayIndexOutOfBoundsException

src/main/java/com/bytelegend/Challenge.java's firstOrNull method returns the first element in the array or null if it's empty, lastOrNull method returns the last element in the array or null if it's empty. Current implementation throws ArrayIndexOutOfBoundsException, please fix it.

  • You can accomplish this challenge via any way below:
    • Recommended for beginners: run git clone https://github.com/ByteLegendQuest/java-fix-index-out-of-bounds-exception to download the code, finish the challenge in your local IDE, then copy/paste/submit the answer in web editor.
    • Very unrecommended: you can click here to download zipped code if you don't like git operations.
    • Or: if you are confident enough to write code in web editor directly, go ahead.
    • Or: if you are familiar with GitHub, you can fork the repo, finish the challenge and create a pull request.
  • The bot will check your PR and tell you if you accomplish the challenge.
  • Go back to ByteLegend and continue your hero journey.

Good luck!

If you need any help, feel free to join the Discord Community or contact us via contact@bytelegend.com.

Note: we only allow you to modify the following files. Any changes to files other than the following files will be rejected:

  • src/main/java/com/bytelegend/Challenge.java
简体中文

修复ArrayIndexOutOfBoundsException

src/main/java/com/bytelegend/Challenge.java中的firstOrNull方法返回数组的第一个元素,若数组为空,则返回nulllastOrNull方法返回数组的最后一个元素,若数组为空,则返回null。 现在的实现会抛出ArrayIndexOutOfBoundsException,请修复之。

  • 你可以使用以下任意一种方法完成挑战:
    • 初学者推荐:运行git clone https://git.bytelegend.com/ByteLegendQuest/java-fix-index-out-of-bounds-exception将代码下载到本地,在本地使用IDE调试完成后复制到网页编辑器里提交。
    • 非常不推荐:如果你实在不喜欢git命令行操作,你可以点击这里直接下载打包好的代码
    • 或者:如果你非常自信不需要下载代码到本地调试,可以使用网页编辑器直接提交。
    • 或者:如果你对GitHub非常熟悉,你可以fork这个仓库、完成挑战后,创建一个Pull Request。
  • 机器人将会检查你的答案,告诉你你是否通过了挑战。
  • 回到字节传说,然后继续你的英雄旅程。

祝你好运!

如果你需要任何帮助,欢迎加入官方玩家QQ群(在首页右下角的联系 & 关于菜单里可以找到入群方式)或者Discord社区,或email至contact@bytelegend.com

注意:我们只允许您修改以下文件,任何对其他文件的修改都会被拒绝:

  • src/main/java/com/bytelegend/Challenge.java
繁體中文

修復ArrayIndexOutOfBoundsException

src/main/java/com/bytelegend/Challenge.javafirstOrNull方法返回數組中的第一個元素,如果為空則返回nulllastOrNull方法返回數組中的最後一個元素,如果為空則返回null 。當前實現拋出ArrayIndexOutOfBoundsException ,請修復它。

  • 您可以通過以下任何方式完成此挑戰:
    • 推薦給初學者:運行git clone https://github.com/ByteLegendQuest/java-fix-index-out-of-bounds-exception下載代碼,在本地 IDE 中完成挑戰,然後復制/粘貼/提交在網頁編輯器中回答。
    • 非常不推薦:如果你不喜歡git操作,可以點擊這裡下載壓縮代碼
    • 或者:如果您有足夠的信心直接在 Web 編輯器中編寫代碼,請繼續。
    • 或者:如果你熟悉 GitHub,你可以 fork倉庫,完成挑戰並創建一個拉取請求。
  • 機器人會檢查你的 PR 並告訴你是否完成了挑戰。
  • 回到ByteLegend繼續你的英雄之旅。

祝你好運!

如果您需要任何幫助,請隨時加入Discord 社區或通過contact@bytelegend.com聯繫我們。

注意:我們只允許您修改以下文件。對以下文件以外的文件的任何更改都將被拒絕:

  • src/main/java/com/bytelegend/Challenge.java
Español

Arreglar ArrayIndexOutOfBoundsException

src/main/java/com/bytelegend/Challenge.java El método firstOrNull devuelve el primer elemento de la matriz o null si está vacío, el método lastOrNull devuelve el último elemento de la matriz o null si está vacío. La implementación actual arroja ArrayIndexOutOfBoundsException , corríjala.

  • Puede lograr este desafío de cualquier manera a continuación:
    • Recomendado para principiantes: ejecute git clone https://github.com/ByteLegendQuest/java-fix-index-out-of-bounds-exception para descargar el código, finalice el desafío en su IDE local, luego copie/pegue/envíe el respuesta en el editor web.
    • Muy poco recomendado: puede hacer clic aquí para descargar el código comprimido si no le gustan las operaciones de git .
    • O: si tiene la confianza suficiente para escribir código en el editor web directamente, adelante.
    • O: si está familiarizado con GitHub, puede bifurcarel repositorio , finalizar el desafío y crear una solicitud de extracción.
  • El bot verificará tu PR y te dirá si logras el desafío.
  • Regrese a ByteLegend y continúe su viaje de héroe.

¡Buena suerte!

Si necesita ayuda, no dude en unirse a la comunidad de Discord o contáctenos a través de contact@bytelegend.com .

Nota: solo le permitimos modificar los siguientes archivos. Cualquier cambio en los archivos que no sean los siguientes archivos será rechazado:

  • src/main/java/com/bytelegend/Challenge.java
العربية

إصلاح ArrayIndexOutOfBoundsException

يقوم أسلوب src / main / java / com / bytelegend / Challenge.java 's firstOrNull بإرجاع العنصر الأول في المصفوفة أو null إذا كان فارغًا ، lastOrNull العنصر الأخير في المصفوفة أو يكون null إذا كان فارغًا. يطرح التنفيذ الحالي ArrayIndexOutOfBoundsException ، يرجى إصلاحه.

  • يمكنك إنجاز هذا التحدي بأي طريقة أدناه:
    • موصى به للمبتدئين: قم بتشغيل git clone https://github.com/ByteLegendQuest/java-fix-index-out-of-bounds-exception لتنزيل الكود ، وإنهاء التحدي في IDE المحلي الخاص بك ، ثم نسخ / لصق / إرسال الإجابة في محرر الويب.
    • غير موصى به على الإطلاق: يمكنك النقر هنا لتنزيل رمز مضغوط إذا كنت لا تحب عمليات git .
    • أو: إذا كنت واثقًا بدرجة كافية لكتابة التعليمات البرمجية في محرر الويب مباشرةً ، فابدأ.
    • أو: إذا كنت معتادًا على GitHub ، فيمكنك تفرعالريبو وإنهاء التحدي وإنشاء طلب سحب.
  • سيتحقق الروبوت من العلاقات العامة الخاصة بك ويخبرك إذا أنجزت التحدي.
  • ارجع إلى ByteLegend وتابع رحلة بطلك.

حظ سعيد!

إذا كنت بحاجة إلى أي مساعدة ، فلا تتردد في الانضمام إلى مجتمع Discord أو الاتصال بنا عبر contact@bytelegend.com .

ملاحظة: نسمح لك فقط بتعديل الملفات التالية. سيتم رفض أي تغييرات يتم إجراؤها على الملفات بخلاف الملفات التالية:

  • src/main/java/com/bytelegend/Challenge.java
Português

Corrigir ArrayIndexOutOfBoundsException

O método firstOrNull de src/main/java/com/bytelegend/Challenge.java retorna o primeiro elemento do array ou null se estiver vazio, o método lastOrNull retorna o último elemento do array ou null se estiver vazio. A implementação atual lança ArrayIndexOutOfBoundsException , corrija-o.

  • Você pode realizar este desafio de qualquer maneira abaixo:
    • Recomendado para iniciantes: execute git clone https://github.com/ByteLegendQuest/java-fix-index-out-of-bounds-exception para baixar o código, termine o desafio em seu IDE local e copie/cole/envie o responda no editor web.
    • Muito não recomendado: você pode clicar aqui para baixar o código zipado se não gostar das operações do git .
    • Ou: se você estiver confiante o suficiente para escrever código diretamente no editor da web, vá em frente.
    • Ou: se você estiver familiarizado com o GitHub, você pode bifurcaro repo , finalizar o desafio e criar um pull request.
  • O bot verificará seu PR e informará se você cumprir o desafio.
  • Volte para ByteLegend e continue sua jornada de herói.

Boa sorte!

Se precisar de ajuda, sinta-se à vontade para se juntar à Comunidade Discord ou entre em contato conosco via contact@bytelegend.com .

Nota: só permitimos que você modifique os seguintes arquivos. Quaisquer alterações em arquivos que não sejam os arquivos a seguir serão rejeitadas:

  • src/main/java/com/bytelegend/Challenge.java
Bahasa Indonesia

Perbaiki ArrayIndexOutOfBoundsException

src/main/Java/com/bytelegend/Challenge.java metode firstOrNull mengembalikan elemen pertama dalam array atau null jika kosong, metode lastOrNull mengembalikan elemen terakhir dalam array atau null jika kosong. Implementasi saat ini melempar ArrayIndexOutOfBoundsException , tolong perbaiki.

  • Anda dapat menyelesaikan tantangan ini melalui cara apa pun di bawah ini:
    • Direkomendasikan untuk pemula: jalankan git clone https://github.com/ByteLegendQuest/java-fix-index-out-of-bounds-exception untuk mengunduh kode, selesaikan tantangan di IDE lokal Anda, lalu salin/tempel/kirim jawab di editor web.
    • Sangat tidak direkomendasikan: Anda dapat mengklik di sini untuk mengunduh kode zip jika Anda tidak menyukai operasi git .
    • Atau: jika Anda cukup percaya diri untuk menulis kode di editor web secara langsung, silakan.
    • Atau: jika Anda terbiasa dengan GitHub, Anda dapat melakukan forkrepo , menyelesaikan tantangan, dan membuat permintaan tarik.
  • Bot akan memeriksa PR Anda dan memberi tahu Anda jika Anda menyelesaikan tantangan.
  • Kembali ke ByteLegend dan lanjutkan perjalanan pahlawan Anda.

Semoga beruntung!

Jika Anda memerlukan bantuan, jangan ragu untuk bergabung dengan Komunitas Discord atau hubungi kami melalui contact@bytelegend.com .

Catatan: kami hanya mengizinkan Anda untuk mengubah file berikut. Setiap perubahan pada file selain file berikut akan ditolak:

  • src/main/java/com/bytelegend/Challenge.java
Français

Correction ArrayIndexOutOfBoundsException

La méthode firstOrNull de src/main/java/com/bytelegend/Challenge.java renvoie le premier élément du tableau ou null s'il est vide, la méthode lastOrNull renvoie le dernier élément du tableau ou null s'il est vide. L'implémentation actuelle lève ArrayIndexOutOfBoundsException , veuillez le corriger.

  • Vous pouvez accomplir ce défi de n'importe quelle manière ci-dessous:
    • Recommandé pour les débutants : exécutez git clone https://github.com/ByteLegendQuest/java-fix-index-out-of-bounds-exception pour télécharger le code, terminez le défi dans votre IDE local, puis copiez/collez/soumettez le réponse dans l'éditeur Web.
    • Très déconseillé : vous pouvez cliquer ici pour télécharger le code compressé si vous n'aimez pas les opérations git .
    • Ou : si vous êtes suffisamment confiant pour écrire du code directement dans l'éditeur Web, continuez.
    • Ou : si vous êtes familier avec GitHub, vous pouvez forkerle dépôt , terminer le défi et créer une demande d'extraction.
  • Le bot vérifiera votre PR et vous dira si vous accomplissez le défi.
  • Retournez à ByteLegend et continuez votre voyage de héros.

Bonne chance!

Si vous avez besoin d'aide, n'hésitez pas à rejoindre la communauté Discord ou à nous contacter via contact@bytelegend.com .

Remarque : nous vous autorisons uniquement à modifier les fichiers suivants. Toute modification de fichiers autres que les fichiers suivants sera rejetée :

  • src/main/java/com/bytelegend/Challenge.java
日本語

ArrayIndexOutOfBoundsExceptionを修正

src / main / java / com / bytelegend / Challenge.javafirstOrNullメソッドは、配列の最初の要素を返すか、空の場合はnullを返しますlastOrNullメソッドは、配列の最後の要素を返します。空の場合はnullを返します。現在の実装ではArrayIndexOutOfBoundsExceptionがスローされます。修正してください。

  • この課題は、以下のいずれかの方法で達成できます。
    • 初心者に推奨: git clone https://github.com/ByteLegendQuest/java-fix-index-out-of-bounds-exceptionを実行してコードをダウンロードし、ローカルIDEでチャレンジを終了してから、コピー/貼り付け/送信します。 Webエディタで答えます。
    • 非常に推奨されていませんgit操作が気に入らない場合は、 ここをクリックしてzipコードをダウンロードできます。
    • または:Webエディターで直接コードを記述できる自信がある場合は、先に進んでください。
    • または:GitHubに精通している場合は、リポジトリをフォークしてチャレンジを終了し、プルリクエストを作成できます。
  • ボットはPRをチェックし、チャレンジを達成したかどうかを通知します。
  • ByteLegendに戻り、ヒーローの旅を続けてください。

幸運を!

ヘルプが必要な場合は、 Discordコミュニティに参加するか、contact @bytelegend.comからお問い合わせください。

注:変更できるのは次のファイルのみです。次のファイル以外のファイルへの変更は拒否されます。

  • src/main/java/com/bytelegend/Challenge.java
Русский

Исправить ArrayIndexOutOfBoundsException

Метод firstOrNull src/main/java/com/bytelegend/Challenge.java возвращает первый элемент массива или null , если он пуст, метод lastOrNull возвращает последний элемент массива или null , если он пуст. Текущая реализация выдает ArrayIndexOutOfBoundsException , исправьте это.

  • Вы можете выполнить эту задачу любым способом, указанным ниже:
  • Бот проверит ваш PR и сообщит, выполнили ли вы задание.
  • Вернитесь в ByteLegend и продолжайте свое героическое путешествие.

Удачи!

Если вам нужна помощь, присоединяйтесь к сообществу Discord или свяжитесь с нами по адресу contact@bytelegend.com .

Примечание: мы разрешаем вам изменять только следующие файлы. Любые изменения в файлах, кроме следующих файлов, будут отклонены:

  • src/main/java/com/bytelegend/Challenge.java
Deutsch

ArrayIndexOutOfBoundsException

Die Methode firstOrNull von src/main/java/com/bytelegend/Challenge.java gibt das erste Element im Array zurück oder null , wenn es leer ist, die Methode lastOrNull gibt das letzte Element im Array zurück oder null , wenn es leer ist. Aktuelle Implementierung ArrayIndexOutOfBoundsException , bitte beheben Sie es.

  • Sie können diese Herausforderung auf eine der folgenden Arten meistern:
  • Der Bot überprüft Ihre PR und teilt Ihnen mit, ob Sie die Herausforderung meistern.
  • Gehen Sie zurück zu ByteLegend und setzen Sie Ihre Heldenreise fort.

Viel Glück!

Wenn Sie Hilfe benötigen, können Sie sich gerne der Discord Community anschließen oder uns über contact@bytelegend.com kontaktieren .

Hinweis: Wir erlauben Ihnen nur, die folgenden Dateien zu ändern. Alle Änderungen an anderen Dateien als den folgenden Dateien werden abgelehnt:

  • src/main/java/com/bytelegend/Challenge.java
한국어

ArrayIndexOutOfBoundsException 수정

src/main/java/com/bytelegend/Challenge.javafirstOrNull 메서드는 배열의 첫 번째 요소를 반환하거나 비어 있으면 null 을 반환하고, lastOrNull 메서드는 배열의 마지막 요소를 반환하거나 비어 있으면 null 을 반환합니다. 현재 구현에서 ArrayIndexOutOfBoundsException 이 발생합니다. 수정하십시오.

  • 아래 방법을 통해 이 챌린지를 완료할 수 있습니다.
    • 초보자를 위한 권장 사항: git clone https://github.com/ByteLegendQuest/java-fix-index-out-of-bounds-exception 을 실행하여 코드를 다운로드하고 로컬 IDE에서 챌린지를 완료한 다음 복사/붙여넣기/제출 웹 편집기에서 대답하십시오.
    • 매우 권장하지 않음: git 작업이 마음에 들지 않으면 여기를 클릭하여 압축 코드를 다운로드 할 수 있습니다.
    • 또는 웹 편집기에서 직접 코드를 작성할 만큼 자신이 있다면 계속 진행하십시오.
    • 또는 GitHub에 익숙하다면 리포지토리를 분기하고 챌린지를 완료하고 풀 요청을 생성할 수 있습니다.
  • 봇은 PR을 확인하고 도전 과제를 달성했는지 알려줍니다.
  • ByteLegend 로 돌아가 영웅 여정을 계속하세요.

행운을 빕니다!

도움이 필요하면 언제든지 Discord 커뮤니티 에 가입하거나 contact@bytelegend.com 을 통해 문의하세요.

참고: 다음 파일만 수정할 수 있습니다. 다음 파일 이외의 파일에 대한 변경 사항은 거부됩니다.

  • src/main/java/com/bytelegend/Challenge.java
Italiano

Correggi ArrayIndexOutOfBoundsException

Il metodo firstOrNull di src/main/java/com/bytelegend/Challenge.java restituisce il primo elemento nell'array o null se è vuoto, il metodo lastOrNull restituisce l'ultimo elemento nell'array o null se è vuoto. L'implementazione corrente genera ArrayIndexOutOfBoundsException , correggilo.

  • Puoi portare a termine questa sfida in qualsiasi modo di seguito:
    • Consigliato per i principianti: esegui git clone https://github.com/ByteLegendQuest/java-fix-index-out-of-bounds-exception per scaricare il codice, completa la sfida nel tuo IDE locale, quindi copia/incolla/invia il risposta nell'editor web.
    • Molto sconsigliato: puoi fare clic qui per scaricare il codice zippato se non ti piacciono le operazioni git .
    • Oppure: se sei abbastanza sicuro da scrivere il codice direttamente nell'editor web, vai avanti.
    • Oppure: se hai familiarità con GitHub, puoi eseguire il forkdel repository , completare la sfida e creare una richiesta pull.
  • Il bot controllerà il tuo PR e ti dirà se hai superato la sfida.
  • Torna a ByteLegend e continua il tuo viaggio da eroe.

Buona fortuna!

Se hai bisogno di aiuto, non esitare a unirti alla community di Discord o contattaci tramite contact@bytelegend.com .

Nota: ti permettiamo solo di modificare i seguenti file. Eventuali modifiche ai file diversi dai seguenti file verranno rifiutate:

  • src/main/java/com/bytelegend/Challenge.java

About

Challenge of JavaIsland: Fix ArrayIndexOutOfBoundsException

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages