NewProject Coding is here — build features and fix bugs in real codebases with an AI assistantSee what's new

Design a digital recipe book that supports creating, reading, updating, and deleting recipes. Each recipe has a unique name, an ordered list of ingredients, and an ordered list of preparation steps.

Implement the RecipeManager class:

  • RecipeManager() Initializes an empty recipe store.

  • String addRecipe(String name, List<String> ingredients, List<String> steps) Adds a new recipe. The name must be unique across all stored recipes (case-insensitive).

    • Returns the assigned recipeId (formatted as "recipe1", "recipe2", etc., assigned sequentially starting from 1). IDs are never reused after deletion.
    • Returns an empty string "" if a recipe with the same name already exists (case-insensitive).
Test Cases
Input
Output
Expected