commit be3435daf66b1f096ed140174686c3d7d3a02991 parent 0ddc9530881bc7c1a76ac0ad5f053b766e3937c0 Author: Plat <plat@stellar-nexus.ru> Date: Thu, 23 Oct 2025 18:57:03 +0000 Fixed the fix of segfault in init Diffstat:
| M | final_solution.cpp | | | 6 | +++--- |
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/final_solution.cpp b/final_solution.cpp @@ -50,15 +50,15 @@ int main() { Node* init(int val) { - Node *n = malloc(sizeof(Node)); - if (Node == NULL) + Node *n = (Node *) malloc(sizeof(Node)); + if (n == NULL) return NULL; n->val = val; n->left = NULL; n->right = NULL; - return &n; + return n; }