Skip to content

"Added solution for pascal"#1178

Open
LeelaTotapally wants to merge 1 commit into
super30admin:masterfrom
LeelaTotapally:master
Open

"Added solution for pascal"#1178
LeelaTotapally wants to merge 1 commit into
super30admin:masterfrom
LeelaTotapally:master

Conversation

@LeelaTotapally

Copy link
Copy Markdown

No description provided.

@super30admin

Copy link
Copy Markdown
Owner

Interview Problem : Two elements sum to target (Problem1.java)

This submission appears to be for the wrong problem entirely. The student solved "Pascal's Triangle" (LeetCode 118) instead of "Two Sum" (LeetCode 1). This could indicate:

  • Confusion about which problem to solve
  • Copy-paste error from another solution
  • Working on multiple problems simultaneously

The Pascal's Triangle code itself is actually quite good - it uses proper variable naming, handles edge cases correctly, and follows clean coding practices. However, since it doesn't solve the assigned problem, it cannot be considered a valid solution.

VERDICT: NEEDS_IMPROVEMENT


Interview Problem: 0-1 Knapsack Problem

The code you submitted solves Pascal's Triangle, which is a completely different problem from the 0-1 Knapsack Problem that was assigned. Your implementation is well-written and correct for Pascal's Triangle generation - it uses proper variable naming, has clear logic, and follows good coding practices.

However, please ensure you submit the correct solution for the assigned problem. For the 0-1 Knapsack Problem, you would need to implement a dynamic programming solution that considers:

  • A 2D DP table where dp[i][j] represents the maximum value achievable with the first i items and a capacity of j
  • For each item, either include it (if weight allows) or exclude it, taking the maximum value
  • The final answer would be dp[n][W] where n is the number of items and W is the knapsack capacity

Your Pascal's Triangle code demonstrates good understanding of dynamic programming concepts (building on previous results), which will help you implement the knapsack solution.

VERDICT: NEEDS_IMPROVEMENT

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.

2 participants